package javabase.schoolwork.day6_12;

import java.util.Iterator;

/**
 * @author fance
 * @date 18-6-13 下午12:26
 */
public class TestDemo {
    public static void main(String[] args) {
        School school = new School("jia li dun");

        Student student1 = new Student("1",1);
        Student student2 = new Student("2",2);
        Student student3 = new Student("3",3);

        school.getStudentList().add(student1);
        school.getStudentList().add(student2);
        school.getStudentList().add(student3);


        System.out.println(school);

        Iterator<Student> iterator = school.getStudentList().iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }
    }
}
